<UserControl x:Class="Rage.UI.ItemButtonWithEnchant"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:local="clr-namespace:Rage.UI"
  xmlns:Rage="clr-namespace:Rage;assembly=Rage.Base.WPF"
  mc:Ignorable="d" Height="Auto" Width="90">

  <UserControl.DataContext>
    <Rage:Character />
  </UserControl.DataContext>
  <UserControl.Resources>
    <Style x:Key="ModButtonStyle" TargetType="Button">
      <Setter Property="Grid.Column" Value="1" />
      <Setter Property="MaxHeight" Value="20" />
      <Setter Property="MinHeight" Value="20" />
      <Setter Property="MaxWidth" Value="20" />
      <Setter Property="MinWidth" Value="20" />
    </Style>
  </UserControl.Resources>

  <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition />
      <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
    <!-- Popups -->
    <Popup x:Name="ListPopup" Grid.ColumnSpan="3" Grid.RowSpan="2" HorizontalOffset="92">
      <local:ItemListControl x:Name="ComparisonItemList" />
    </Popup>
    <Popup x:Name="ListPopupItemModType1" Grid.Column="1" Grid.Row="0" HorizontalOffset="22">
      <local:ItemListControl x:Name="ComparisonItemListItemModType1" />
    </Popup>
    <Popup x:Name="ListPopupItemModType2" Grid.Column="1" Grid.Row="1" HorizontalOffset="22">
      <local:ItemListControl x:Name="ComparisonItemListItemModType2" />
    </Popup>
    <Popup x:Name="ListPopupItemModType3" Grid.Column="1" Grid.Row="2" HorizontalOffset="22">
      <local:ItemListControl x:Name="ComparisonItemListItemModType3" />
    </Popup>
    <Popup x:Name="ListPopupItemModType4" Grid.Column="1" Grid.Row="2" HorizontalOffset="22">
      <local:ItemListControl x:Name="ComparisonItemListItemModType4" />
    </Popup>
    <Popup x:Name="ListPopupItemModType5" Grid.Column="1" Grid.Row="2" HorizontalOffset="22">
      <local:ItemListControl x:Name="ComparisonItemListItemModType5" />
    </Popup>
    <StackPanel Grid.RowSpan="6">
      <!-- Main Button-->
      <Button x:Name="MainButton" Height="70" Width="70" Margin="0" Click="MainButton_Clicked" MouseEnter="MainButton_MouseEnter" MouseLeave="AnyButton_MouseLeave" MouseRightButtonUp="MainButton_MouseRightButtonUp">
        <ContextMenuService.ContextMenu>
          <ContextMenu x:Name="ContextMenuItem" Opened="ContextMenuItem_Opened">
            <MenuItem x:Name="ContextItemName" Header="Super Cool Item" IsEnabled="False" />
            <Separator />
            <MenuItem x:Name="ContextEdit" Click="EditItem" Header="Edit..." />
            <MenuItem x:Name="ContextOpenKNotor" Click="OpenInKnotor" Header="Open in Knotor" />
            <!--<MenuItem x:Name="ContextRefreshArmory" Header="Refresh Item from Armory" Click="RefreshItemFromArmory" Visibility="Collapsed"/>-->
            <!--<MenuItem x:Name="ContextRefreshTorhead" Click="RefreshItemFromTorhead" Header="Refresh Item from Torhead" />-->
            <!--<MenuItem x:Name="ContextEquip" Header="Equip" Click="EquipItem"/>-->
            <!--<MenuItem x:Name="ContextAddCustom" Header="Add Custom ItemModTypeming..." Click="AddCustomItemModTypeming" Visibility="Collapsed"/>-->
            <!--<MenuItem x:Name="ContextDeleteCustom" Header="Delete Custom ItemModTypeming" Click="DeleteCustomItemModTypeming" Visibility="Collapsed"/>-->
            <!--<MenuItem x:Name="ContextEvaluateUpgrade" Header="Evaluate Upgrade..." Click="EvaluateUpgrade"/>-->
            <!--<MenuItem x:Name="ContextEvaluateUpgradesBySlot" Header="Evaluate Upgrades for this Slot..." Click="EvaluateUpgradesbySlot"/>-->
            <!--<MenuItem x:Name="ContextRemoveItemFromUpgradeList" Header="Remove Item from Upgrade List" Click="ContextRemoveItemFromUpgradeList_Click"/>-->
          </ContextMenu>
        </ContextMenuService.ContextMenu>
        <Image x:Name="IconImage" Height="Auto" Width="Auto" HorizontalAlignment="Center" Stretch="UniformToFill" VerticalAlignment="Center" />
      </Button>
      <!-- Augment Enabler -->
      <CheckBox x:Name="CK_Augment" Margin="2" Content="Augment" FontSize="10" Checked="CK_Augment_Checked" Unchecked="CK_Augment_Checked" />
    </StackPanel>
    <!-- Mod Buttons -->
    <Button x:Name="ItemModTypeButton1" Style="{StaticResource ModButtonStyle}" Click="ItemModTypeButton1_Click" Grid.Row="0" MouseEnter="ItemModTypeButton1_MouseEnter" MouseLeave="AnyButton_MouseLeave">
      <Image x:Name="IconImageItemModType1" Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Button>
    <Button x:Name="ItemModTypeButton2" Style="{StaticResource ModButtonStyle}" Click="ItemModTypeButton2_Click" Grid.Row="1" MouseEnter="ItemModTypeButton2_MouseEnter" MouseLeave="AnyButton_MouseLeave">
      <Image x:Name="IconImageItemModType2" Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Button>
    <Button x:Name="ItemModTypeButton3" Style="{StaticResource ModButtonStyle}" Click="ItemModTypeButton3_Click" Grid.Row="2" MouseEnter="ItemModTypeButton3_MouseEnter" MouseLeave="AnyButton_MouseLeave">
      <Image x:Name="IconImageItemModType3" Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Button>
    <Button x:Name="ItemModTypeButton4" Style="{StaticResource ModButtonStyle}" Click="ItemModTypeButton4_Click" Grid.Row="3" MouseEnter="ItemModTypeButton4_MouseEnter" MouseLeave="AnyButton_MouseLeave">
      <Image x:Name="IconImageItemModType4" Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Button>
    <Button x:Name="ItemModTypeButton5" Style="{StaticResource ModButtonStyle}" Click="ItemModTypeButton5_Click" Grid.Row="4" MouseEnter="ItemModTypeButton5_MouseEnter" MouseLeave="AnyButton_MouseLeave">
      <Image x:Name="IconImageItemModType5" Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Button>
  </Grid>
</UserControl>